/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entidades;

import java.io.Serializable;
import java.sql.Timestamp;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Version;

/**
 *
 * @author Felipe
 */
@Entity
@Table (name = "CONFIGS_EMAIL")
@NamedQueries({
    @NamedQuery (name = "buscarTodos", query = "select c from ConfigEmail c")
})
public class ConfigEmail implements Serializable
{
    @Id
    @GeneratedValue (strategy = GenerationType.IDENTITY)
    private long id;
    private String nombre;
    private String hostSalida;
    private int puertoSMTP;
    
    private String email;
    private String clave;
    
    @Version
    private Timestamp version;
    
    public ConfigEmail ()
    {
        
    }

    public ConfigEmail(String nombre, String hostSalida, int puertoSMTP, String email, String clave)
    {
        this.nombre = nombre;
        this.hostSalida = hostSalida;
        this.puertoSMTP = puertoSMTP;
        this.email = email;
        this.clave = clave;
    }
    
    public long getId ()
    {
        return this.id;
    }
    
    public void setId (long id)
    {
        this.id = id;
    }

    public String getNombre ()
    {
        return this.nombre;
    }
    
    public void setNombre (String nombre)
    {
        this.nombre = nombre;
    }
    
    public String getHostSalida()
    {
        return hostSalida;
    }

    public void setHostSalida(String hostSalida)
    {
        this.hostSalida = hostSalida;
    }

    public int getPuertoSMTP()
    {
        return puertoSMTP;
    }

    public void setPuertoSMTP(int puertoSMTP)
    {
        this.puertoSMTP = puertoSMTP;
    }

    public String getEmail()
    {
        return email;
    }

    public void setEmail(String email)
    {
        this.email = email;
    }

    public String getClave()
    {
        return clave;
    }

    public void setClave(String clave)
    {
        this.clave = clave;
    }
    
    @Override
    public String toString ()
    {
        return this.nombre + " - " + this.email;
    }
}
